package wowrl.engine;

public class Dice {
	public static int RandomNumberDoubleBound(int minimum, int max1, int max2)
	{
		return RandomNumberRange(minimum, Math.min(max1,max2));
	}
	public static int RandomNumberRange(int minimum, int maximum)
	{
		return minimum + RandomInteger(maximum-minimum);
	}
	
	public static int RandomInteger(int maximum)
	{
		return (int)(Math.random() * (maximum+1));
	}
	
	public static int roll(int numSides)
	{
		return (int) ((Math.random() * numSides) + 1);		
	}
	
	public static int roll(int numSides, int numDice)
	{
		int total = 0;		
		for(int die = 0; die < numDice ; die++)
		{			
			total += roll(numSides);
		}		
		return total;
	}
	
}
